<extend name="base" />
<block name="js2">
    <script type="text/javascript">
        $(function(){
            $('button[name="back"]').click(function(event) {
                window.location.href='<{:U("Home/Module/moduleInfo",array("type"=>$result["type"]))}>';
            });
        })
    </script>
</block>
<block name="meau">
    <div class="col-sm-3 col-md-2 sidebar">
        <ul class="nav nav-sidebar">
            <switch name='result["type"]'>
                <case value="土建专业">
                    <li class="active"><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"土建专业"))}>'>土建专业</a></li>
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"铁塔专业"))}>'>铁塔专业</a></li>
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"配套专业"))}>'>配套专业</a></li>
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"交流专业"))}>'>交流专业</a></li>
                </case>
                <case value="铁塔专业">
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"土建专业"))}>'>土建专业</a></li>
                    <li class="active"><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"铁塔专业"))}>'>铁塔专业</a></li>
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"配套专业"))}>'>配套专业</a></li>
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"交流专业"))}>'>交流专业</a></li>
                </case>
                <case value="交流专业">
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"土建专业"))}>'>土建专业</a></li>
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"铁塔专业"))}>'>铁塔专业</a></li>
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"配套专业"))}>'>配套专业</a></li>
                    <li class="active"><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"交流专业"))}>'>交流专业</a></li>

                </case>
                <case value="配套专业">
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"土建专业"))}>'>土建专业</a></li>
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"铁塔专业"))}>'>铁塔专业</a></li>
                    <li class="active"><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"配套专业"))}>'>配套专业</a></li>
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"交流专业"))}>'>交流专业</a></li>
                </case>
                <default />
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"土建专业"))}>'>土建专业</a></li>
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"铁塔专业"))}>'>铁塔专业</a></li>
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"配套专业"))}>'>配套专业</a></li>
                    <li ><a href='<{:U("Home/Module/ModuleInfo",array("type"=>"交流专业"))}>'>交流专业</a></li>
          </switch>
        </ul>
    </div>
</block>
<block name="content">
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
        <h2 class="sub-header"><{$result['type']}><{$result['module_name']}>优惠率管理
        <button class="btn btn-default" style="margin-left:20px;height:32px" name="back">返回</button>
        <a href='<{:U("Home/Module/discount", array("number"=>$result["number"], "status"=>"add",
        "moduel_name"=>$result["module_name"], "type"=>$result["type"], "class"=>$result["class"], "id"=>$result["id"]))}>'><button type="button" class="btn btn-default" style="float:right;"  data-toggle="modal">
        <font color="#0099CC">新增单位优惠率</font></button></a> </h2>
        <div class="table table-responsive ">
            <table class="table table-striped table-bordered table-condensed">
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>模块名称</th>
                        <th>简要工作内容</th>
                        <th>分类</th>
                        <th>基准价</th>
                        <th>安全生产费</th>
                        <th>合计</th>
                        <th>计量单位</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td  style="width:50px;"><{$result.id}></td>
                        <td><{$result.module_name}></td>
                        <td title="<{$result.remark}>">工作内容</td>
                        <td><{$result.class}></td>
                        <td><{$result.baseprice}></td>
                        <td><{$result.safeprice}></td>
                        <td><{$result['baseprice']+$result['safeprice']}></td>
                        <td><{$result.measure}></td>
                    </tr>
                </tbody>
            </table>
        </div>
        <br /><br />
        <div class="table table-responsive ">
            <table class="table table-striped table-bordered table-condensed">
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>单位名称</th>
                        <th>优惠区间</th>
                        <th>优惠率</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <foreach name="moduleData" item="v">
                        <tr>
                            <td style="width:50px;"><{$v.id}></td>
                            <td>
                                <foreach name="userData" item="s">
                                    <if condition='$v["uid"] eq $s["uid"]'>
                                        <{$s.company}>
                                    </if>
                                </foreach>
                            </td>
                            <td><{$v.lsection}>--<{$v.rsection}></td>
                            <td><{$v.discount}></td>
                            <td style="width:150px;" >
                                <div class="btn-group btn-group-xs" role="group" aria-label="...">
                                    <button type="button" class="btn btn-default" data-toggle="modal" ><a class="link" href='<{:U("Home/Module/discount",array("status"=>"mod","id"=>$v["id"],"modid"=>$result["id"],"type"=>$v["type"]))}>'>修改</a></button>
                                    <button type="button" class="btn btn-default" data-toggle="modal" onclick="if(confirm('确定删除吗?'))
                                    {return true;}return false;"><a class="link" href='<{:U("Home/Module/discount",array("status"=>"del","id"=>$v["id"],"modid"=>$result["id"]))}>'>删除</a></button>
                                </div>
                            </td>
                        </tr>
                    </foreach>
                    <tr>
                        <if condition="$count gt $listRows">
                            <td colspan="5"><{$show}></td>
                        </if>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</block>


